package com.demo.commons.exception.customize;

import com.demo.commons.constant.HttpStatusR;

/**
 * <p>自定义异常</p>
 *@author zwy
 *@date 2023/8/10 18:00
*/
public class RRException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    private String msg;
    private int code = HttpStatusR.ERROR;

    public RRException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public RRException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public RRException(int code,String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public RRException(int code,String msg, Throwable e) {
        super(msg, e);
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
